﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
using UnityEngine;

public class _28 : MonoBehaviour
{
    public List<int> list = new List<int>() { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
    // Start is called before the first frame update
    void Start()
    {
        var temp1 = from c in list where c > 5 select c;//延迟查询
        var temp2 = (from c in list where c > 5 select c).ToList<int>();//主动求值
        list[0] = 11;
        foreach (var item in temp1)
        {
            Debug.LogErrorFormat("{0}", item);
        }
        Debug.LogError("---------分割线---------");
        foreach (var item in temp2)
        {
            Debug.LogErrorFormat("{0}", item);
        }
    }

    // Update is called once per frame
    void Update()
    {

    }
}
